package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"
	"ssadmin/internal/admin/apis"
)

func init() {
	AuthRouters = append(AuthRouters, registerRoleRouter)
}

// registerRoleRouter
func registerRoleRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.Role{}
	r := v1.Group("/api/role").Use(authMiddleware.MiddlewareFunc())
	{
		r.GET("/find", api.FindList)
		r.GET("/menu/find", api.GetMenuIdList)
		r.GET("/get", api.Get)
		r.POST("/add", api.Insert)
		r.POST("/modify", api.Update)
		r.POST("/remove", api.Delete)
		r.GET("/find/recur", api.FindRecurList)
	}
}
